package com.ruiyin.service;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.UUID;

public class BaseService {

    //当前时间
    public String getDate(){
        return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date());
    }

    public static String setDate(Integer n){
        Date d=new Date();
        SimpleDateFormat df=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        return df.format(new Date(d.getTime() + n * 24 * 60 * 60 * 1000L));
    }
    //用户id
    public String getID(){
        return UUID.randomUUID().toString().replace("-","");
    }
}
